package pl.edu.utp.kursy.database;

import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "accomodation")
public class Accomodation extends BaseId{
    
    @Column(name = "name")
    private String name;
    
    @Column(name = "address")
    private String address;
    
    @Column(name = "zip_code")
    private String zipCode;
    
    @Column(name = "city")
    private String city;
    
    @Column(name = "phone")
    private String phone;
    
    @Column(name = "fax")
    private String fax;
    
    @Column(name = "email")
    private String email;
    
    @Column(name = "description")
    private String description;
    
    @OneToMany(fetch = FetchType.EAGER, mappedBy = "accomodation",cascade = CascadeType.REMOVE)
    private Set<CourseEventCompanyAccomodation> courseEventsCompanyAccomodation;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Set<CourseEventCompanyAccomodation> getCourseEventsCompanyAccomodation() {
        return courseEventsCompanyAccomodation;
    }

    public void setCourseEventsCompanyAccomodation(Set<CourseEventCompanyAccomodation> courseEventsCompanyAccomodation) {
        this.courseEventsCompanyAccomodation = courseEventsCompanyAccomodation;
    }
    
    @Override
    public String toString(){
        return getName();
    }
}